<?php

if(!empty($_POST["ulozitVzhled"])) {
    
    $set = array();
    $aSet[] = array("sNumRows");
    $aSet[] = array("sMapView");
    $aSet[] = array("sImgViewEvidList");       
            
            
    $set = nastavSet($aSet,true);
    if($idZaznamu = ModifyTable("core_uzivatele",$set,"idUzivatele = '".$_SESSION["usrSettings"]["idUzivatele"]."'")) { 
        
        
        //okazmite reflektujeme zmenu u prihlaseneho usera
        $_SESSION["usrSettings"]["sNumRows"]            = $_POST["sNumRows"];
        $_SESSION["usrSettings"]["sMapView"]            = $_POST["sMapView"];
        $_SESSION["usrSettings"]["sImgViewEvidList"]    = $_POST["sImgViewEvidList"];
        
        aLog("osobni",$idZaznamu,3);
        msgUser("ok",1); 
    } else {
        msgUser("error",2);
    }

}

	
/* =================================
 * zobrazení záznamů
 * ================================= */	
echo '<h2>Log</h2>';
 
$query = "    SELECT
                        idUzivatele,
                        puvodniJmenoUsr,
                        modul,
                        idAkce,
                        actionName,
                        Ref1,
                        Ref1Txt,
                        Ref2,
                        Ref3,
                        DATE_FORMAT(cas,'%d. %m. %Y %H:%i:%s') AS fcas
                FROM
                        core_log
                ORDER BY
                        idRadku DESC
                ";
$result = $db->PageExecute($query, $_SESSION["usrSettings"]["sNumRows"],$_GET["currentPage"]);   
$num = $result->RecordCount();
$strankovani = strankovani($result);
echo $strankovani;        

echo '
    <table id="Classic">
        <tr id="Title">
            <td width="160">Čas</td>
            <td width="160">Uživatel</td>
            <td width="160">Modul</td>
            <td>Akce</td>
            <td>Dotčený záznam</td>                        
        </tr>
';

foreach($result as $key => $row) {
    echo '
        <tr class="B'.dvojka().'">
            <td>'.$row["fcas"].'</td>
            <td>'.$row["puvodniJmenoUsr"].'</td>
            <td>'.$row["modul"].'</td>
            <td>'.$row["actionName"].'</td>
            <td>'.$row["Ref1Txt"].'</td>
        </tr>
';
}        
echo '</table>';
echo $strankovani;



?>
